<html>
    <header>
        <meta charset="utf-8"/>
    </header>
    <script>
        function submit() {
            let file = document.getElementById("file").files[0];
            var form = new FormData();
            form.append("key", "panda");
            form.append("file", file);
            form.append("suffix", "jpeg");

            var xhr = new XMLHttpRequest();
            xhr.open("post", "/save", true);
            xhr.onload = function () {
                alert("上传完成!");
            };
            xhr.setRequestHeader("enctype", "multipart/form-data");
            xhr.setRequestHeader("contentType", false);
            xhr.send(form);
        }
    </script>
    <body>
        <h1>hello word!!!</h1>
        <p>this is a html page</p>

        <input type="file" id="file">

        <button onclick="submit()">提交</button>

        <img src="./get/panda/a46f6fdd-bddf-472e-901a-c6ab39129c3a.jpeg">
    </body>
</html>